package com.demo.fieldunique;

import cn.lingyangwl.framework.mybatis.mate.annotations.FieldUniqueCheck;
import cn.lingyangwl.framework.mybatis.mate.enums.OperationTypeEnum;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author shenguangyang
 */
@Service
public class FieldUniqueService {
    @Resource
    private FieldUnique01Mapper fieldUnique01Mapper;

    @FieldUniqueCheck(type = OperationTypeEnum.SAVE)
    public void save(FieldUniquePO01 req) {
        fieldUnique01Mapper.insert(req);
    }

    public void save01(FieldUniquePO01 req) {
        fieldUnique01Mapper.insert(req);
    }

    @FieldUniqueCheck(type = OperationTypeEnum.UPDATE)
    public void update(FieldUniquePO01 req) {
        fieldUnique01Mapper.insert(req);
    }

    public void update01(FieldUniquePO01 req) {
        fieldUnique01Mapper.updateById(req);
    }
}
